Skip to content

Conversation

@AhmadGill7
Copy link

Name (to be shown on DefiLlama): Kaspa Finance V3 (KFC)
Twitter Link: https://x.com/KaspaFinance
List of audit links if any:
Website Link: https://app.kaspafinance.io/swap
Logo (High resolution): https://app.kaspafinance.io/images/chains/0xf87e587ab945f7b111329a6ace6dc497d34f098b.png
Current TVL: $5.12k
Treasury Addresses:
Chain: Kasplex
Coingecko ID:
Coinmarketcap ID:
Short Description: Discover the most used AMM on KASPLEX and IGRA Caravel! Farm KFC tokens, take part in innovative token launches through Initial Farm Offerings by Kaspa Finance, collect unique NFTs, and enjoy a reliable, community-driven platform.
Token address and ticker:
Category: DEX
Oracle Provider(s): None (TVL is computed directly from blockchain)
Github org/user:

Changes

  • ✅ Added projects/kaspafinance/index.js with v3 pool TVL tracking
  • ✅ Implemented CoinGecko price mapping for known tokens (ZEAL, NACHO, KASPER, etc.)
  • ✅ Updated projects/helper/coreAssets.json with relevant token addresses
  • ✅ Removed obsolete projects/kfc.js file

Implementation Details

  • Fetches pool creation events from KaspaFinance v3 factory (0x09df701f1f5df83a3bbef7da4e74bb075199d6a4)
  • Aggregates token balances across all pools starting from block 484634
  • Maps known token addresses to CoinGecko IDs for accurate price data
  • Handles decimal conversion for proper TVL calculation
  • Falls back to kasplex:address format for unmapped tokens

Oracle Provider

None - TVL is computed directly from blockchain data

Testing

  • ✅ Tested locally with node test.js projects/kaspafinance/index.js
  • ✅ TVL calculation working correctly with CoinGecko price integration
  • ✅ Current TVL: $5.12k

@llamabutler
Copy link

The adapter at projects/kaspafinance exports TVL:

kasplex                   5.12 k

total                    5.12 k 

@waynebruce0x
Copy link
Collaborator

is this a uniswap fork? if so, please use our helper functions instead

@waynebruce0x
Copy link
Collaborator

Why delete the KFC adapter file?

@waynebruce0x waynebruce0x self-assigned this Nov 4, 2025
@AhmadGill7
Copy link
Author

is this a uniswap fork? if so, please use our helper functions instead

With the helper functions, the TVL calculation was coming out incorrect. Using this custom code allows us to fetch live asset prices directly from our Factory, which ensures accurate TVL values. Also, this project is a PancakeSwap fork, not a Uniswap fork.

@AhmadGill7
Copy link
Author

Why delete the KFC adapter file?

That file was part of our project, and we removed it to maintain a cleaner and more organized folder structure. We also tried using the helper functions and our subgraph for TVL calculation, but the most accurate results come from this current approach. The subgraph method was also providing correct values, but since your team rejected it, we explored and implemented this alternative.

@waynebruce0x
Copy link
Collaborator

Please dont delete the adapter file, we can mark it as dead instead

Please use the helper functions, we can add pricing support to any assets that are missing from the TVL calculation

@AhmadGill7
Copy link
Author

Please dont delete the adapter file, we can mark it as dead instead

Please use the helper functions, we can add pricing support to any assets that are missing from the TVL calculation

Great! If you can add price support for these tokens, then this PR won’t be needed.
Here are the tokens with their CoinGecko IDs:

const ADDRESS_TO_CG = {
"0xb7a95035618354d9adfc49eca49f38586b624040": "zeal",
"0x9a5a144290dffa24c6c7aa8ca9a62319e60973d8": "nacho-the-kat",
"0x1f3ce97f8118035dba7fbcd5398005491cf45603": "kasper",
"0x98508da68180e3c23bee5685f14ad2da5195da12": "keiro",
"0x0fd8d408ce707f4e4f8e54193c4c55a3b969834b": "krex",
"0xc47c03309c1c5e17b4a0b542dec2e47c99f16a5d": "mambo",
};

I’d really appreciate it if you could add pricing support for these tokens.
However, I’m still not entirely sure if the TVL will match the accuracy we’re currently getting with our approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants